
package com.wwy.monitor.service;

import com.wwy.monitor.model.tddl.dto.MonitorConfigDetailDTO;
import com.wwy.monitor.model.tddl.query.MonitorConfigDetailQuery;
import com.wwy.monitor.model.tddl.vo.MonitorConfigDetailVo;

import java.util.List;

/**
 * @author tianquan.ld
 * @version V1.0
 * <p>Description: çæ§配置详情 service</p>
 * @date 2019-10-30 21:17
 */
public interface MonitorConfigDetailService {
    /**
     * æ°å»º
     *
     * @param entity
     * @return
     */
    boolean insert(MonitorConfigDetailDTO entity);

    /**
     * å é¤
     *
     * @param id
     * @return
     */
    boolean deleteById(Long id);

    /**
     * æ ¹æ®åºç¨idé»è¾å é¤éç½®è¯¦æ
     *
     * @param appId åºç¨id
     * @return é»è¾å é¤æ¡æ°
     */
    int deleteByAppId(Long appId);

    /**
     * æ´æ°
     *
     * @param entity
     * @return
     */
    boolean updateById(MonitorConfigDetailDTO entity);

    /**
     * æ ¹æ®åºç¨idä¸çº¿ææéç½®è¯¦æ
     *
     * @param appId åºç¨id
     * @return ä¸çº¿éç½®è¯¦ææ¡æ°
     */
    int offlineConfigDetailByAppId(Long appId);

    /**
     * æ¥è¯¢
     *
     * @param query
     * @return
     */
    List<MonitorConfigDetailVo> selectByQuery(MonitorConfigDetailQuery query);

    /**
     * æ ¹æ®åºç¨idæ¥è¯¢ææéç½®è¯¦æ
     *
     * @param query
     * @return é ç½®è¯¦æéå
     */
    List<MonitorConfigDetailDTO> selectByCondition(MonitorConfigDetailQuery query);

    /**
     * æ ¹æ®idéåãåºç¨idæ¥è¯¢éç½®è¯¦æ
     *
     * @param appId åºç¨id
     * @param list  éç½®è¯¦æidéå
     * @return é ç½®è¯¦ææ°æ®
     */
    List<MonitorConfigDetailVo> selectByAppIdAndIds(Long appId, List<Long> list);

    /**
     * æ ¹æ®idæ¥è¯¢
     *
     * @param id
     * @return
     */
    MonitorConfigDetailDTO selectById(Long id);

    /**
     * æ ¹æ®éç½®è¯¦æidï¼è·åçæ§配置详情ä¿¡æ¯
     *
     * @param detailId éç½®è¯¦æid
     * @return é ç½®è¯¦æä¿¡æ¯
     */
    MonitorConfigDetailVo findById(Long detailId);

    /**
     * å¨é¨æ°é
     *
     * @return
     */
    Integer count(MonitorConfigDetailQuery query);

    /**
     * åºç¨åç§°å¯ä¸校验
     *
     * @param detailName åºç¨åç§°
     * @return
     */
    Integer selectCountByDetailName(Long id, Long appId, String detailName);

    boolean updateAlertDelayTimeById(MonitorConfigDetailDTO entity);
}